package com.waverider.promotion.biz.manager;

import java.util.List;

import com.taobao.api.domain.Item;
import com.waverider.promotion.domain.OrderDO;
import com.waverider.promotion.domain.PromotionDO;
import com.waverider.promotion.model.ItemQueryModel;
import com.waverider.promotion.model.PromotionQueryModel;
import com.waverider.promotion.model.ResultModel;

/**
 * 
 * @author sihai
 * 
 */
/**
 * @author IBM
 * 
 */
public interface ItemManager {
	String MARK = "<div style=\"color:#333333;font-family:微软雅黑 宋体 verdana tahoma sans-serif;width:716.0px;margin-left:30.0px;border:2.0px solid #95bd5a;font-size:16.0px;margin-bottom:10.0px;\">.*</div>";

	String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";

	// ///////////////////////////////////////////////////////////////////
	//
	// Discount
	//
	// ///////////////////////////////////////////////////////////////////
	/**
	 * @param item
	 * @param promotion
	 */
	void addPromotion(String sessionKey, Item item, PromotionDO promotion);

	/**
	 * 
	 * @param goodsId
	 * @return
	 */
	PromotionDO getPromotionByGoodsId(Long goodsId);

	/**
	 * 
	 * @param id
	 * @return
	 */
	PromotionDO getPromotionById(Long id);

	/**
	 * 
	 * @param queryModel
	 * @return
	 */
	ResultModel<PromotionDO> getPromotionList(PromotionQueryModel queryModel);

	List<PromotionDO> getExpirePromitonByShopId(Long shopId);

	/**
	 * 
	 * @param promotion
	 * @return
	 */
	boolean updatePromotion(String sessionKey, PromotionDO promotion,
			boolean isNew);

	/**
	 * 
	 * @param sessionKey
	 * @param id
	 * @param goodsId
	 * @return
	 */
	boolean delete(String sessionKey, Long id, Long goodsId);

	/**
	 * 
	 * @param sessionKey
	 * @param promotion
	 * @param order
	 * @return
	 */
	boolean syncPromotion(String sessionKey, PromotionDO promotion,
			OrderDO order);

	// ///////////////////////////////////////////////////////////////////
	//
	// Item
	//
	// ///////////////////////////////////////////////////////////////////
	ResultModel<Item> getItemList(String sessionKey, ItemQueryModel queryModel);

	/**
	 * 
	 * @param sessionKey
	 * @param itemId
	 * @return
	 */
	Item getItem(String sessionKey, Long itemId);

	/**
	 * 
	 * @param sessionKey
	 * @param promotion
	 * @param isNew
	 * @return
	 */
	boolean updateItemPromotionInfo(String sessionKey, PromotionDO promotion,
			boolean isNew);

	/**
	 * @param sessionKey
	 * @param promotionId
	 * @return
	 */
	boolean recommendOne(String sessionKey, Long itemId, Long promotionId);

	/**
	 * @param sessionKey
	 * @param itemIdList
	 * @param promotionId
	 * @return
	 */
	boolean recommendSome(String sessionKey, List<Long> itemIdList,
			Long promotionId, Long shopId);

	/**
	 * @param sessionKey
	 * @param promotionId
	 * @return
	 */
	boolean recommendAll(String sessionKey, Long promotionId, Long shopId);

	/**
	 * @param shopId
	 * @return
	 */
	public int getValidatePromotionCountByShopId(Long shopId);
}
